#!/usr/bin/env ruby -w
#--
# Project:      pkgman
# File:         test/create_prototypes.rb
# Revision:     $Id$
# Home:         http://code.google.com/p/pkgman/
# Author:       Derek Olsen <someword at gmail dot com>
# Copyright:    (c) 2007 by Derek Olsen
# License:      GNU General Public License v2 
#++

# Simple script which i used to create the 40 install/remove pkgs
# doesnt do much besides that.

# Pkg prototype prefix.  Easy to see in pkginfo output
$prefix = "ZZZpkgman" 

# Create the directory and the pkginfo/prototype files
def make_dir(a,d)
   name = $prefix + "-" + a + "-" + d
   ver = rand(5).to_s + "." + d + rand(100).to_s
  Dir.mkdir(name)

pkginfo=<<_EOF
PKG=#{name}
NAME="test package"
ARCH="all"
VERSION=#{ver}
CATEGORY="application"
VENDOR="NA"
EMAIL="NA"
PSTAMP="NA"
BASEDIR="/"
CLASSES="none"
_EOF

prototype=<<_EOF
i pkginfo
_EOF

   File.new("#{name}/pkginfo", "w+") << pkginfo
   File.new("#{name}/prototype", "w+") << prototype

end
"a0".upto "b9" do |n|
  make_dir("install",n)
end

"y0".upto "z9" do |n|
  make_dir("remove",n)
end
